package myDesiign.com.song;

import myDesiign.com.song.beans.Abean;
import myDesiign.com.song.beans.MyBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @Author Klys
 * @Date 2023/6/18 22:57
 * @Description
 * @Version 1.0
 */
@SpringBootApplication
public class MyApplication {

    public static void main(String[] args) throws NoSuchFieldException {
        ConfigurableApplicationContext context = SpringApplication.run(MyApplication.class, args);
        String[] definitionNames = context.getBeanDefinitionNames();
//        遍历容器中的bean
        for (String name : definitionNames) {
            System.out.println(name);
        }
//        MyBean bean = (MyBean) context.getBean("myBean");
//        MyBean bean1 = context.getBean(MyBean.class);
//        System.out.println(bean1);


    }
}
